<!-- 新增标签拉群 -->
 <template>
  <div>
    <div class="header-btn">
      <div>{{ title }}</div>
      <div>
        <el-button type="primary" @click="addOrUpdateTask" :loading="addLoading">确认</el-button>
        <el-button type="info" plain @click="goBack">返回</el-button>
      </div>
    </div>
    <el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="right"
      style="position: relative">
      <div class="wrap g-card" style="margin-bottom: 20px">
        <div class="title-header">基础信息</div>
        <el-form-item label="任务名称" prop="aaaa" required>
          <el-input type="text" placeholder="请输入" v-model="form.aaaa" style="width: 600px" />
        </el-form-item>
        <el-form-item label="添加超级企微" required>
          <select-supermicro ref="checkDigitalEmployee" v-model="scrmPersonSopUserRels"
            :btn-info.sync="supermicroBtnInfo" :is-single-option="isSingleOption"></select-supermicro>
        </el-form-item>
      </div>
      <div class="wrap g-card" style="margin-bottom: 20px">
        <div class="title-header">群信息</div>
        <el-form-item label="群聊名称" prop="bbbb" required>
          <el-input type="text" placeholder="请输入" v-model="form.aaaa" style="width: 600px" />
        </el-form-item>
        <el-form-item label="群目标人数" prop="cccc" required>
          <el-input-number placeholder="请输入" v-model="form.aaaa" style="width: 150px" :min="0" />
        </el-form-item>
        <!-- <el-form-item label="群初始编号" prop="aaaa" required>
          <el-input-number placeholder="请输入" v-model="form.aaaa" style="width: 150px" min="0" />
        </el-form-item> -->
        <!-- <el-form-item label="群欢迎语" prop="aaaa" required>
          <el-input type="text" placeholder="请输入" v-model="form.aaaa" style="width: 600px" />
        </el-form-item> -->
      </div>
    </el-form>
  </div>
</template>

<script>
import selectSupermicro from "@/components/selectSupermicro.vue";
export default {
  name: "LabelGroupAdd",
  components: {
    selectSupermicro,
  },
  data() {
    return {
      title: "新增标签拉群",
      addLoading: false,
      // 基础设置
      form: {},
      rules: {
        aaaa: [{ required: true, message: "请输入任务名称", trigger: "blur" }],
        bbbb: [{ required: true, message: "请输入群聊名称", trigger: "blur" }],
        cccc: [
          { required: true, message: "请输入群目标人数", trigger: "blur" },
        ],
      },
      scrmPersonSopUserRels: [],
      supermicroBtnInfo: "添加超级企微",
      isSingleOption: false,
    };
  },
  created() {},
  methods: {
    addOrUpdateTask() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.addLoading = true;
          this.$message({
            message: "添加成功",
            type: "success",
          });
          this.addLoading = false;
          this.$router.go(-1);
        }
      });
    },
    // 返回
    goBack() {
      this.$router.go(-1);
    },
  },
};
</script>

<style lang="scss" scoped>
@import "../../../styles/base.scss";

.header-btn {
  @include headerBtn;
}

.wrap {
  @include titleWrap;
}
</style>